/*
	Copyright 2012 J. Gohlke
	Licensed under the Apache License, Version 2.0 (the
	"License"); you may not use this file except in
	compliance with the License. You may obtain a copy
	of the License at

	http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in
	writing, software distributed under the License is
	distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
	OR CONDITIONS OF ANY KIND, either express or
	implied. See the License for the specific language
	governing permissions and limitations under the
	License
 */
package com.gohlke.lwo.textures;



/**
 *
 * @author David Wise
 * 
 * Gradient textures that modify a surface channel by mapping 
 * an input parameter through an arbitrary transfer function. 
 * Gradients are represented to the user as a line containing keys. 
 * Each key is a color, and the gradient function is an interpolation 
 * of the keys in RGB space. The input parameter selects a point on the line, 
 * and the output of the texture is the value of the gradient at that point.
 * 
 */
public class GradientMap  extends TextureMap {
    
    public final String[] inputParams = {
      "Previous Layer",
      "Bump",
      "Slope",
      "Incidence Angle",
      "Light Incidence",
      "Distance to Camera",
      "Distance to Object",
      "X Distance to Object",
      "Y Distance to Object",
      "Z Distance to Object",
      "Weight Map"
    };
    
    /*
     * The input parameter
     */
    public String paramName;
    /*
     * The name of a scene item. This is used when the input parameter 
     * is derived from a property of an item in the scene.
     */
    public String itemName;
    /*
     * The start of the input range.
     * This value only affect the display of the gradient in the 
     * user interface. It doesn't affect rendering.
     */
    public float start;
    /*
     * The start of the input range.
     * This value only affect the display of the gradient in the 
     * user interface. It doesn't affect rendering.
     */
    public float end;
    /*
     * The repeat mode. This is currently undefined.
     */
    public int repeat;
    /*
     * The transfer function is defined by an array of keys, 
     * each with an input value and an RGBA output vector. 
     * Given an input value, the gradient can be evaluated by 
     * selecting the keys whose positions bracket the value and
     * interpolating between their outputs. If the input value 
     * is lower than the first key or higher than the last key, 
     * the gradient value is the value of the closest key.
     */
    public GradientKey[] keys;
    /*
     * An array of integers defining the interpolation
     * for the span preceding each key. 
     */
    public GradientInterpolationType[] interpolationCodes;
}
